package tbitem

import (
	"encoding/xml"
	"sync"

	"github.com/bububa/opentaobao/model"
)

// TaobaoItemSkuDeleteAPIResponse 删除SKU API返回值
// taobao.item.sku.delete
//
// 删除一个sku的数据&lt;br/&gt;需要删除的sku通过属性properties进行匹配查找
type TaobaoItemSkuDeleteAPIResponse struct {
	model.CommonResponse
	TaobaoItemSkuDeleteAPIResponseModel
}

// Reset 清空结构体
func (m *TaobaoItemSkuDeleteAPIResponse) Reset() {
	(&m.CommonResponse).Reset()
	(&m.TaobaoItemSkuDeleteAPIResponseModel).Reset()
}

// TaobaoItemSkuDeleteAPIResponseModel is 删除SKU 成功返回结果
type TaobaoItemSkuDeleteAPIResponseModel struct {
	XMLName xml.Name `xml:"item_sku_delete_response"`
	// 平台颁发的每次请求访问的唯一标识
	RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
	// Sku结构
	Sku *Sku `json:"sku,omitempty" xml:"sku,omitempty"`
}

// Reset 清空结构体
func (m *TaobaoItemSkuDeleteAPIResponseModel) Reset() {
	m.RequestId = ""
	m.Sku = nil
}

var poolTaobaoItemSkuDeleteAPIResponse = sync.Pool{
	New: func() any {
		return new(TaobaoItemSkuDeleteAPIResponse)
	},
}

// GetTaobaoItemSkuDeleteAPIResponse 从 sync.Pool 获取 TaobaoItemSkuDeleteAPIResponse
func GetTaobaoItemSkuDeleteAPIResponse() *TaobaoItemSkuDeleteAPIResponse {
	return poolTaobaoItemSkuDeleteAPIResponse.Get().(*TaobaoItemSkuDeleteAPIResponse)
}

// ReleaseTaobaoItemSkuDeleteAPIResponse 将 TaobaoItemSkuDeleteAPIResponse 保存到 sync.Pool
func ReleaseTaobaoItemSkuDeleteAPIResponse(v *TaobaoItemSkuDeleteAPIResponse) {
	v.Reset()
	poolTaobaoItemSkuDeleteAPIResponse.Put(v)
}
